package com.hejiale.lease.common.threadlocal;

import com.hejiale.lease.model.entity.LoginUser;

/**
 * @description: 线程本地变量处理
 * @author: HeJiale
 * @since 2025/3/21 上午12:09
 */

public class LoginThreadLocalHolder {
    public static ThreadLocal<LoginUser> threadLocal = new ThreadLocal<>();

    public static void setLoginUser(LoginUser loginUser) {
        threadLocal.set(loginUser);
    }

    public static LoginUser getLoginUser() {
        return threadLocal.get();
    }

    public static void clear() {
        threadLocal.remove();
    }
}
